Skip to content

fix(app-shell): a screen-flow wizard step toasts "Saved — next step" only when it saved a record - #26656

Merged
objectstack-fleet[bot] merged 2 commits into
mainfrom
claude/project-thread-xuv7w9
Oct 27, 2026
Merged

objectstack-fleet[bot] merged 2 commits into
mainfrom
claude/project-thread-xuv7w9

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Requested by Steedos · project thread

Part of #26578. This lands the toast half; the step-button half stays open on the card, because it needs a signal the wire does not carry (see Acceptance notes).

Clause-②: no
Metadata-protocol: none

维护者速读

  • 改了什么:屏幕流向导里,纯字段步骤之间不再弹「已保存 — 下一步」;只有 object-form 步骤(它真的保存了一条记录)还弹。流程结束时的提示不变。
  • 为什么改:hotclm 的发起合同向导在第 3 步才建记录,第 1、2 步却都提示「已保存」,用户误以为已经提交。
  • 风险与回滚:只动 FlowRunner.tsx 的一个分支,纯前端文案行为;回滚即 revert 本 PR。
  • 先看:ui/packages/app-shell/src/views/FlowRunner.tsx(resumeWith 的 savedRecord 参数与 paused 分支),FlowRunner.betweenStepsToast-26578.test.tsx,FlowRunner.actionSuccessMessage-12234.test.tsx 的改动。
  • 两分钟验证:pnpm --dir ui exec vitest run packages/app-shell/src/views/__tests__/FlowRunner,预期 15 个文件、94 个测试全绿。
  • 需要你做的:无,席位落地。

What changes

  • FlowRunner's resumeWith takes a savedRecord flag. The flat-field Submit passes false; the object-form save callback passes true.
  • When the resume answers paused, the flowRunner.nextStep toast ("Saved — next step") fires only when savedRecord is true. A flat step that only collected variables now advances to the next screen with no toast. An object-form step keeps it: ObjectForm calls onSuccess only after its write lands, and passing onSuccess silences the form's own confirmation, so this toast is the user's only one.
  • Terminal toasts (the action's successMessage, the flow's, the catalog sentence), the refused and failed paths, and the step button are unchanged.
  • The FlowRunner header gains a section stating the rule and the measured limit on the button label.

Why

Reported on hotclm's five-step contract wizard: every step toasted 「已保存 — 下一步」, including steps that saved nothing, so a requester believed the contract was submitted on step 1.

Tests

  • New FlowRunner.betweenStepsToast-26578.test.tsx: a flat step that pauses again toasts nothing; an object-form step that pauses again toasts exactly Saved — next step (full call list); a flat step that ends the run still gets the completion toast.
  • FlowRunner.actionSuccessMessage-12234.test.tsx: its multi-step pin asserted the old between-steps toast on flat screens; it now asserts the action message alone, and its docblock says why.

Acceptance notes

  • The step button still reads Submit on every flat step. This is a measured limit, not a choice. Showing "Next" on a step that is not the last needs to know which step is the last. Measured on origin/main: the paused screen (ScreenSpec in packages/spec/src/contracts/automation-service.ts) carries nodeId, title, description, fields, kind, objectName, mode, recordId, defaults and idVariable, and no final-step or step-count member. The engine's screen executor (packages/services/service-automation/src/builtin/screen-nodes.ts) emits exactly those. A flow can branch after any screen, so only the engine could answer it, from the graph. The only client-side signal is after the fact: a resume that answers paused proves the previous step was not the last.
  • The same gap keeps a step counter out: the run never knows a total.
  • Closing the button half needs a server-computed wire member on ScreenSpec (for example, whether any screen node is reachable downstream of this one). That is a contract addition in packages/spec, so it is reported to the seat rather than built here. An author-declared button label would be a protocol addition, which triage ruled goes back to triage first.

Verification

Head a746e566.

FlowRunner suites (ui root, under os-verify-lock)

pnpm exec vitest run --maxWorkers=2 packages/app-shell/src/views/__tests__/FlowRunner → Test Files 15 passed (15), Tests 94 passed (94), VERDICT command-exit 0.

Type-check

pnpm --filter @object-ui/app-shell type-check (runs tsc --noEmit and tsc -p tsconfig.test.json, the latter covering __tests__) → VERDICT command-exit 0.

Ablation (one, on the changed behaviour)

Through scripts/ablation-replace.mjs: anchor if (savedRecord) toast.success( replaced by if (savedRecord || true) toast.success( (anchor 1 → 0, blob 1ed20f953095 → 244560514f7f). Running the new pin file and the 12234 file: Tests 2 failed | 10 passed. The flat-step pin fails on toast.success called once; the 12234 multi-step pin fails with [['已保存 — 下一步'], ['工单已升级']] against [['工单已升级']]. Restored: blob equals HEAD and git diff HEAD is empty. A first attempt used an undeclared identifier in the replacement, which threw instead of toasting; it was discarded as invalid.

Derived gates

node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack: 34 commands, each run with its exit code recorded. --ran at a746e566: 34 derived, 34 run, 0 NOT-MEASURED, 0 UNRUN; every exit code 0. The ui scripts/ suite in that list: Test Files 178 passed | 2 skipped (180). pnpm check:new-line-citations (ui): 0 new citation(s).


Generated by Claude Code

…only when it saved a record

A flat step that only collected input no longer toasts between screens;
an object-form step, which persisted its record, keeps the toast. The
terminal toasts are unchanged. The step button keeps Submit: the paused
screen carries no final-step signal, recorded in the FlowRunner header.

Claude-Session: https://claude.ai/code/session_01QsR2jQzKBjxZXgyVnom2V3
Co-authored-by: Claude <noreply@anthropic.com>
…ween flat screens

Claude-Session: https://claude.ai/code/session_01QsR2jQzKBjxZXgyVnom2V3
Co-authored-by: Claude <noreply@anthropic.com>
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

席位核对

ACCEPT · seat domain:ui#4 · session_01QsR2jTfvjNTaR29ehLk26T · 2026-10-27T11:47Z · head a746e5660f927158534c1d6a74c80e72bc8a2979

  1. Shape: draft, base main, first line Part of #26578. The card's step-button and counter items were split to Screen flows: the paused screen does not say whether it is the last one, so a wizard button reads 「提交」 on every step and no step counter can be drawn #26657 (card note 6441002688), so Part of is correct and no closing keyword is in the body. Clause-②: no / Metadata-protocol: none match the claim (6440134516), in the body and in the changeset. Files: 4, all inside the claimed surface (FlowRunner.tsx, two FlowRunner tests, .changeset/26578-flow-wizard-between-steps-toast.md). No content/docs/releases/.
  2. Premise, measured: the seat read the diff. resumeWith gains savedRecord; the flat-field submit passes false, the object-form save passes true; the paused branch toasts only if (savedRecord). The terminal, refused and failed paths are untouched. The report's measurement that ScreenSpec carries no last-screen member is accepted as the reason for the split; it is not re-measured here.
  3. Gates, pinned to the head: check-runs at a746e566: 52 total, 43 success, 9 skipped (Core, Docs, Dogfood and opt-in legs that a ui-only diff does not run), 0 failed. Lint & Repo Gates, TypeScript Type Check, Check Changeset, Governed Surface Queue Guard, Type Check UI, Lint UI, Test UI (16 shards plus aggregate) and Build & E2E UI are all success. check-governed-merges --pr 26656: not governed, 202 changed lines ≤ 3000. mergeable_state: clean.
  4. Accepted deviations: the 12234 multi-step pin was flipped from the old between-steps toast to the action message alone; that is a load-bearing flip of the very behaviour this card changes, and the ablation shows both pins red without the fix. The report says the first ablation was discarded as invalid and redone.
  5. Out of scope: the step button label and step counter → Screen flows: the paused screen does not say whether it is the last one, so a wizard button reads 「提交」 on every step and no step counter can be drawn #26657 (filed by the seat, for triage). Skills-docs: not owed (Metadata-protocol: none, no narrowing).
  6. Prose face, checked sentence by sentence against the diff: the changeset's four claims ("a step with plain input fields that leads to another screen now shows no toast", "an object-form step still shows…", "the toast at the end of the run is unchanged", "the step button still reads Submit") each match a hunk. The FlowRunner header section says the same.

Landing: no contract review owed (no published schema, no governed text, Clause-②: no). The seat marks the PR ready and arms auto-merge. On MERGED, the seat closes #26578 as completed, pointing at #26657.


Generated by Claude Code

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review October 27, 2026 11:49
@objectstack-fleet
objectstack-fleet Bot enabled auto-merge October 27, 2026 11:49
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Oct 27, 2026
Merged via the queue into main with commit cabe2ed Oct 27, 2026
53 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/project-thread-xuv7w9 branch October 27, 2026 12:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/m tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants